import requests

#get参数
# res = requests.get(url="http://httpbin.org/get?name=qiku&address=东三街")
# print(res.json())

# res = requests.get("http://httpbin.org/get",params={"name":"qiku","address":"东三街"})
# print(res.json())

# res = requests.get("http://httpbin.org/get?name=qiku",params={"address":"东三街"})
# print(res.json())

#post参数
#'Content-Type': 'application/x-www-form-urlencoded'使用data
# res = requests.post(url="http://httpbin.org/post",data={
#     "name":"admin",
#     "pwd":"123456"
# })
# print(res.json())

#'Content-Type': 'application/json'使用json
res = requests.post(url="http://httpbin.org/post",json={
    "name":"admin",
    "pwd":"123456"
})
print(res.json())
